<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AlterProductDefaultValue extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        // 增加product表默认值
        \Illuminate\Support\Facades\DB::statement("ALTER TABLE `kf_rms`.`kf_products` 
MODIFY COLUMN `categoryId` bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '分类id' AFTER `brandId`,
MODIFY COLUMN `name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '菜品名称' AFTER `categoryId`,
MODIFY COLUMN `desc` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '菜品描述' AFTER `name`,
MODIFY COLUMN `imageUrl` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '菜品图片' AFTER `desc`,
MODIFY COLUMN `unit` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '菜品单位' AFTER `imageUrl`,
MODIFY COLUMN `price` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '菜品价格，分' AFTER `unit`,
MODIFY COLUMN `costPrice` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '菜品成本价格，分' AFTER `price`,
MODIFY COLUMN `vipPrice` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '菜品vip价格，分' AFTER `costPrice`,
MODIFY COLUMN `createdAt` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间',
MODIFY COLUMN `updatedAt` int(11) NOT NULL DEFAULT 0 COMMENT '修改时间';");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
}
